﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using DataTier;
using BusinessTier;
using System.IO;

namespace ElectricCarService
{
    // NOTE: You can use the "Rename" command on the "Refactor" menu to change the class name "Service1" in both code and config file together.
    public class ElectricCarService : IElectricCarService
    {

        private PersonCtr _personCtr = PersonCtr.Instance;
        private PathFinderCtr _pathFinderCtr = PathFinderCtr.Instance;
        private ReservationCtr _reservationCtr = ReservationCtr.Instance;
        private LocationCtr _locationCtr = LocationCtr.Instance;
        private StationCtr _stationCtr = StationCtr.Instance;

        public Customer Login(int customerId, string password)
        {
            return _personCtr.GetCustomer(customerId, password);
        }

        public Route FindPath(Location start, Location to)
        {
            return _pathFinderCtr.FindPath(start, to);
        }

        public bool AddReservation(Customer customer, Route route)
        {
            return _reservationCtr.AddReservation(customer, route);
        }

        public IList<Reservation> GetReservations(Customer customer)
        {
            return _reservationCtr.GetReservations(customer);
        }

        public void RemoveReservation(Reservation reservation)
        {
            _reservationCtr.RemoveReservation(reservation);
        }

        public IList<Location> GetAllLocations()
        {
            return _locationCtr.GetAllLocations();
        }

        public IList<Station> GetAllStations()
        {
            return _stationCtr.GetAllStations();
        }

    }
}
